DD is a module that performs Newton’s divided differences for you.
The points must be entered as {x,y} where x is a list of x values and y is the list of y values. This will not work unless x’s are in increasing order, and there are no repeated x values.

The first thing returned is the top row of newton’s divided differences; these are the coefficients used in building the polynomial.
The second thing displayed is the entire table showing all the underlying work.
This is followed by the polynomial, written in unsimplified form, followed by the simplified form.

The following is a way to capture the polynomial and save it as a function for later use if you wish to plot the function. You don’t have to use “x”. You can use whatever variable you want. In fact, if you put a number, it’ll evaluate the polynomial for you at that point (along with the usual table generation)

DD[{<<x values>>,<<y values>>},x]
 f[x_] = %

ClearAll[DD]
DD[{xp_,yp_},x_]:=
Module[{l={xp,yp},n=Length[xp],c,p,t},
(* Calculate divided differences *)
Do[AppendTo[l,Table[((l[[-1,i]]-l[[-1,i+1]])/(l[[1,i]]-l[[1,i+j]])),{i,Length[l[[-1]]]-1}]],{j,n-1}];
(* Coefficients *)
Print[c=l[[2;;n+1,1]]];
(* Insert spaces in between the values *)
t=Riffle[#,""]&/@l;
(* Pad each row with spaces before and after *)
t=Fold[Prepend[Append[#1,#2],#2]&,#,Table["",(Length[t[[1]]]-Length[#])/2]]&/@t;
(* Rotate and display like in the book *)
Grid[t//Transpose,Dividers->{{2->True}}]//Print;
(* Build polynomial *)
p=Sum[c[[i]]Product[x-l[[1,j]],{j,1,i-1}],{i,n}];
(* Display polynomial along with simplified version *)
Print[p];
p//Expand
]

Example with a few points

p={{-1,2},{0,3},{2,-1}};
DD[p//Transpose,x]
Show[Plot[%,{x,-3,3},PlotRange->{-2,4}],ListPlot[p,PlotStyle->Red]]

Here is an example of DD with some points. Also, the polynomial is captured and saved in the function f.

p={{-5,1},{-4,-1},{-3,1},{-2,-1},{-1,1},{0,-1},{1,1},{2,-1},{3,1},{4,-1},{5,1}};
DD[p//Transpose,x]
f[x_]=%;
Show[Plot[f[x],{x,-6,6},PlotRange->{-5,5}],ListPlot[p,PlotStyle->Red]]